
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>图书交易平台 - 更新</title>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="${pageContext.request.contextPath}\style\update.css" rel="stylesheet">
</head>
<body>
<div class="form-container">
    <div class="form-header">
        <h2 class="form-title">
            <i class="material-icons">edit</i>
            更新书籍信息
        </h2>
        <a href="index.jsp" class="back-btn">
            <i class="material-icons">arrow_back</i>
            返回
        </a>
    </div>

    <c:if test="${not empty error}">
        <div class="error-message">
            <i class="material-icons">error</i>
                ${error}
        </div>
    </c:if>

    <form action="bookupdate" method="post">
        <input type="hidden" name="id" value="${book.id}">

        <div class="form-group">
            <label for="name">书名</label>
            <input type="text" id="name" name="name"
                   value="${book.name}" required
                   placeholder="请输入书名">
        </div>

        <div class="form-group">
            <label for="author">作者</label>
            <input type="text" id="author" name="author"
                   value="${book.author}" required
                   placeholder="请输入作者">
        </div>

        <div class="form-group">
            <label for="publisher">出版社</label>
            <input type="text" id="publisher" name="publisher"
                   value="${book.publisher}" required
                   placeholder="请输入出版社">
        </div>

        <div class="form-group">
            <label for="price">价格</label>
            <input type="text" id="price" name="price"
                   value="${book.price}" required
                   placeholder="请输入价格">
        </div>

        <div class="button-group">
            <button type="button" class="btn btn-cancel" onclick="window.location.href='index.jsp'">
                <i class="material-icons">close</i>
                取消
            </button>
            <button type="submit" class="btn btn-submit">
                <i class="material-icons">check</i>
                确认更新
            </button>
        </div>
    </form>
</div>
</body>
</html>

